package com.dianxun.exam.net;

import android.content.Context;
import android.text.TextUtils;
import android.widget.TextView;

import com.dianxun.exam.R;
import com.dianxun.exam.entity.ServiceResult;
import com.yanzhenjie.nohttp.RequestMethod;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Map;

/**
 * 接口定义
 */
public class Api {

//    public static final int what_tiku = 0x01;
    public static final int what_save = 0x02;

//    /**
//     * 获取试卷信息
//     * @param context
//     * @param versionNo
//     * @param rspCls
//     */
//    public static void getTiku(Context context, int versionNo, HttpListener<ServiceResult> netCallBack, Class<?> rspCls) {
//        String url = "mapps.tikuInfo.get";
//        Map<String, Object> map = null;
//        if (versionNo != 0) {
//            map =  new HashMap<>();
//            map.put("versionNo", versionNo);
//        }
//        CallServer.getInstance().request(context, what_tiku, url, map, null, netCallBack, rspCls);
//    }

    /**
     * 上传试卷
     * @param context
     * @param answerListJson
     * @param rspCls
     */
    public static void save(Context context, String answerListJson, HttpListener<ServiceResult> netCallBack, Class<?> rspCls) {
        String url = "mapps.exam.save";
        Map<String, Object> map = new HashMap<>();
        map.put("answerListJson", answerListJson);
        CallServer.getInstance().request(context, what_save, url, map, context.getString(R.string.wait_upload), netCallBack, rspCls);
    }
}